import { stringify } from 'qs';
import request from '../utils/request';

/*利用json-server数据*/
export async function orglist() {
  //查列表数据
  return request('http://localhost:3000/organization', {
    method: 'GET',
  });
}
export async function orgDetail(params) {
  //详情数据
  return request(`http://localhost:3000/organization/${params}`, {
    method: 'GET',
  });
}
export async function removeorg(params) {
  //删除数据
  return request('http://localhost:3000/organization/' + params, {
    method: 'DELETE',
  });
}
export async function updateOrg(id, values) {
  //修改数据
  return request(`http://localhost:3000/organization/${id}`, {
    method: 'PATCH',
    body: values,
  });
}
export async function creatorg(params) {
  //增添数据
  return request('http://localhost:3000/organization', {
    method: 'POST',
    body: params,
  });
}
//关键字检索
export async function queryOrg (params) {
  //表单条件查询
  return request(`http://localhost:3000/organization?${stringify(params)}`, {
    method: 'GET',
  });
} 
/* export async function cardDetail(params) {
  //详情数据
  return request(`http://localhost:3000/cards/${params}`, {
    method: 'GET',
  });
}
 export async function creatcard(params) {
  //增添数据
  return request('http://localhost:3000/cards', {
    method: 'POST',
    body: params,
  });
}
export async function removecard(params) {
  //删除数据
  return request('http://localhost:3000/cards/' + params, {
    method: 'DELETE',
  });
}
export async function updateCard(id, values) {
  //修改数据
  return request(`http://localhost:3000/cards/${id}`, {
    method: 'PATCH',
    body: values,
  });
}
//关键字检索
export async function queryCard (params) {
  //表单条件查询
  return request(`http://localhost:3000/cards?${stringify(params)}`, {
    method: 'GET',
  });
} */
